<%--
  Created by IntelliJ IDEA.
  User: wuzhuya
  Date: 2023/5/15
  Time: 上午11:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="../js/jquery-3.6.0.js"></script>
</head>
<body>
<div>
    <form id="myform" action="${pageContext.request.contextPath}/forward/tonewmodel">
        <input type="hidden" name="Content-Type" value="application/json">
        <table>
            <tr>
                <td>用户名:</td>
                <td><input type="text" name="username" id="username"></td>
            </tr>
            <tr>
                <td>密码:</td>
                <td><input type="password" name="password" id="password"></td>
            </tr>
            <tr>
                <button id="post_button">点击我进行ModelAndView跳转</button>
            </tr>
        </table>
    </form>
</div>
</body>
<script type="text/javascript">
    /*$(document).ready(function () {
        $("#myform").submit(function () {
            event.preventDefault();
            var user = $('#username').val()
            var pass = $('#password').val()
            $.ajax({
                type: "POST",
                url: "${pageContext.request.contextPath}/forward/tonewmodel",
                data: JSON.stringify({
                    username: user,
                    password: pass
                }),
                contentType: 'application/json'
            })
        })
    })*/
</script>
</html>
